//确定是否划到这个容器refName的底部,vueObject在使用时传入this即可
export const refIsEnd = (vueObject,refName) => {
    console.log(vueObject)
    let container = vueObject.$refs[refName];
    console.log(container)
    console.log(`clientHeight:${container.clientHeight}`);
    console.log(`scrollTop:${container.scrollTop}`);
    console.log(`scrollHeight:${container.scrollHeight}`);
    console.log(`clientHeight+scrollTop:${container.scrollTop+container.clientHeight}`);
    console.log(`clientHeight+scrollTop-scrollHeight:${container.scrollTop+container.clientHeight-container.scrollHeight}`);
    let endY = container.scrollTop+container.clientHeight-container.scrollHeight;// endY < -20 就是没到底
    return endY >= -20;
}
//划到这个容器refName的底部,vueObject在使用时传入this即可,没有滑动过程
export const refToEnd_NoAction = (vueObject,refName) => {
    vueObject.$nextTick(function () {
        let container = vueObject.$refs[refName]
        container.scrollTo({        //滚动动画
            top: container.scrollHeight,
        })
    })
}
//划到这个容器refName的底部,vueObject在使用时传入this即可,有滑动过程
export const refToEnd_Action = (vueObject,refName) => {
    vueObject.$nextTick(function () {
        let container = vueObject.$refs[refName]
        container.scrollTo({        //滚动动画
            top: container.scrollHeight,
            behavior: "smooth"
        })
    })
}

